#ifndef __EXTERNS_HPP__
#define __EXTERNS_HPP__

#include <vector>
extern std::vector<int> PARAMS;

#include "../common/definitions.h"

#ifndef STATIC_ALLOC
extern double (* A)[2][Npadded][Npadded][Npadded];
extern double (* Acheck)[2][Npadded][Npadded][Npadded];
#else
extern double A[1][2][Npadded][Npadded][Npadded] __attribute__ ((aligned(16)));
extern double Acheck[1][2][Npadded][Npadded][Npadded] __attribute__ ((aligned(16)));
#endif // STATIC_ALLOC

#include <pthread.h>
// SWARM-specific 1 per task type to wait
extern pthread_mutex_t initialization_waiter;
extern pthread_cond_t initialization_cv;

extern pthread_mutex_t final_waiter;
extern pthread_cond_t final_cv;

extern int volatile count_shared;
extern int global_count;

extern int finished_heat3d;
extern int finished_initialization;

#include <swarm/type_setup.h>
#include <swarm/Locale.h>
#include <swarm/Latch.h>
#include <swarm/Bool.h>
#include <swarm/Runtime.h>
#include <swarm/Resource.h>
#include <swarm/Scheduler.h>
#include <swarm/Env.h>
#include <swarm/Identifiable.h>
#include <swarm/util/atomic.h>
#include <swarm/TagTable.h>
#include <eti/tracing.h>
#include <eti/swarm_convenience.h>

extern "C" {
  extern swarm_CodeletDesc_DECL(heat3d);
  extern swarm_CodeletDesc_DECL(startup);
  extern swarm_CodeletDesc_DECL(finalize);
  extern swarm_CodeletDesc_DECL(initialize_once);
}

extern swarm_TagTable_t polySwarmTaskTags;


#endif //  __EXTERNS_HPP__
